home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_teo_imp1wall.cog < prev    next >
Text File  |  1999-11-15  |  7KB  |  196 lines

  1. # Jones 3d Cog Script
  2. #
  3. # gen_ExplodingDebris.cog
  4. #
  5. # Generic debris/sub explosions generation script
  6. #
  7. # [SXC]
  8. #
  9. # (C) 1998 LucasArts Entertainment Co. All Rights Reserved
  10. # ========================================================================================
  11.  
  12. symbols
  13.     message     damaged
  14.     message     startup
  15.     message     activate
  16.     message     pulse    
  17.  
  18.     thing       player                              local 
  19.     thing       dust                              local 
  20.     thing       extcampos                           
  21.     thing        bombpos                             desc=explode_thing
  22.     thing       smokepos                            
  23.     thing       bombcampos                          desc=position for bombcam
  24.                                                     
  25.     surface     outerwall                           mask=0x408      desc=hit_this_thing
  26.                                                     
  27.     sector      holesector                                  
  28.                                                     
  29.     template    debris0=stoneshrapa_nc              local         
  30.     template    debris1=stoneshrapb_nc              local         
  31.     template    debris2=stoneshrapc_nc              local         
  32.     template    debris3=stoneshrapa_nc              local         
  33.     template    debris4=stoneshrapb_nc              local
  34.                                                     
  35.     template    smoke0=dustcloud                    local
  36. #    template    smoke1=+pistol_smoke2               local
  37. #    template    smoke2=+pistol_smoke2               local         
  38.                                                     
  39.     vector      liteval                             local
  40.     vector      nolite                              local
  41.                                                     
  42.     int            dummy                                local
  43.     int         hitit=0                             local
  44.     int            pieces=40                            desc=num_debris
  45.     int            i                                    local
  46.     int            fragment                            local
  47.     int         vibe                                local
  48.     int         wepnum=1                            local
  49.     vector      posOffset                           local      
  50.     vector      angOffset                           local
  51.     
  52.     sound        explode_snd=gen_bazooka_fire.wav    local
  53.     sound       charging=nub_aethlight_on_c.wav     local
  54.     
  55.     sound       indyline0=inxj025.wav               local
  56.     sound       indyline1=inxj026.wav               local
  57.     
  58.     sound       indylineb0=inxj058.wav              local
  59.     sound       indylineb1=inxj059.wav              local
  60.     sound       indylineb2=inxj060.wav              local
  61.     sound       indylineb3=inxj061.wav              local
  62.     sound       indylineb4=inxj090.wav              local
  63.     sound       indylineb5=inxj095.wav              local
  64.  
  65. end
  66. # ========================================================================================
  67.  
  68. code
  69.  
  70. # ========================================================================================
  71. activate:
  72.     //handles indy just activating the wall with nothing in his hand
  73.     //print("Indy is knocking on the door");
  74.     if ((GetSenderRef() == outerwall) && 
  75.         (GetSourceRef() == player) && 
  76.         (GetCurWeapon(player) != 14) && 
  77.         (GetCurItem(player) == 0))
  78.     {
  79.         StartCutscene(0);
  80.         SetActorFlags(player, 0x200000);
  81.         StopThing(player);
  82.         PlayMode(player, 60, 0);
  83.         SetExtCamOffsetToThing(extcampos);
  84.         PlayVoice(player, indyline0[RandBetween(0,1)], 1, 1);
  85.         Sleep(1);
  86.         RestoreExtCam();
  87.         EndCutscene();
  88.         ClearActorFlags(player, 0x200000);
  89.         
  90.     }
  91.     
  92.     if  ((GetSenderRef() == outerwall) &&
  93.          (GetSourceRef() == player) &&   
  94.          (GetCurItem(player) != 0))      
  95.     {
  96.         StopThing(player);
  97.         StartCutscene(0);
  98.         SetActorFlags(player, 0x200000);
  99.         PlayVoice(player, indylineb0[(RandBetween(0, 5))], 1, 1);
  100.         EndCutscene();
  101.         ClearActorFlags(player, 0x200000);
  102.     }
  103. return;
  104. # ========================================================================================
  105.  
  106. startup:
  107.     player=GetLocalPlayerThing();
  108.     liteval=VectorSet(0.25, 0.55, 1.0);
  109.     nolite=VectorSet(0, 0, 0);
  110.     SetFaceGeoMode(outerwall, 4);               //draw on
  111.     ClearAdjoinFlags(outerwall, 2);             //no move
  112.     return;
  113.     
  114. # ========================================================================================
  115.  
  116. damaged:
  117.  
  118.     //printint(GetCurItem(player));
  119.     if (GetCurWeapon(player) != 14) return;     //checking for imp1
  120.     if (GetParam(1) != 0x1000) return;          //checking for damage type
  121.     hitit=1;
  122.     StartCutscene(1);
  123.     SetActorFlags(player, 0x200000);
  124.     SetActorFlags(player, 0x8);
  125.     SetCameraFocus(0, bombcampos);
  126.     SetCurrentCamera(0);
  127.     SetPulse(0.1);
  128.     vibe=2;
  129.     SetCameraFOV(120, 1, 3.0);
  130.     PlaySoundPOS(charging, (GetSurfaceCenter(outerwall)), 1.0, 10.0, 20.0, 0);
  131.     SetThingLight(player, liteval, 2.0, 2);
  132.     Sleep(3);                                                                                        
  133.     dummy = PlaySoundThing(explode_snd, bombpos, 1.0, 10.0, 20.0, 0);
  134.  
  135.     dust = CreateThing(smoke0, smokepos);
  136.     AnimateSpriteSize(dust, '0.02 0.02 1.0', '0.8 0.8 0.0', 2.0);
  137.     
  138.     //fragment generator
  139.     for(i=0; i<pieces; i=i+1)                                                                        
  140.     {                                                                                                    
  141.         fragment = CreateThing(debris0[RandBetween(0, 4)], bombpos);                                 
  142.         SetThingVel(fragment, VectorScale(VectorAdd(RandVec(), '-0.5 -0.5 0.0'), 2));
  143.         SetThingRotVel(fragment, VectorScale(VectorAdd(RandVec(), '0.0 0.0 0.0'), 900.0));                    
  144.     }
  145.  
  146.     //render through the adjoin
  147.     SetFaceGeoMode(outerwall, 0);
  148.     SetAdjoinFlags(outerwall, 2);
  149.     sleep(1);
  150.     SetThingLight(player, nolite, 2.0, 2);
  151.     
  152.     //reset camera elements
  153.     SetPulse(0);
  154.     SetCurrentCamera(1);
  155.     SetCameraFOV(90, 0, 0);
  156.     ClearActorFlags(player, 0x200000);                                                                     
  157.     ClearActorFlags(player, 0x8);
  158.     EndCutscene();
  159.     
  160.     return;
  161.     
  162. # ========================================================================================
  163.  
  164. pulse:
  165.  
  166.     vibe = RandBetween(1, 4);
  167.     if (vibe == 1)
  168.     {
  169.         posOffset = '-0.005 0.00 -0.002';
  170.         angOffset = '0.00 -0.002 0.002';
  171.     }
  172.     if (vibe == 2)
  173.     {
  174.         posOffset = '0.005 -0.005 0.002';
  175.         angOffset = '0.002 0.00 -0.002';
  176.     }
  177.     if (vibe == 3)
  178.     {
  179.         posOffset = '0.002 0.005 -0.005';
  180.         angOffset = '-0.002 0.002 -0.002';
  181.     }
  182.     if (vibe == 4)
  183.     {
  184.         posOffset = '-0.002 0.00 0.005';
  185.         angOffset = '0.00 0.00 0.002';
  186.     }
  187.  
  188.     SetPOVShake(posOffSet, angOffSet, 200.0, 200.0);
  189.  
  190. return;    
  191.                                                                                           
  192. # ========================================================================================
  193.  
  194. end
  195.  
  196.